package com.feng.zhihao.apigeteway.gateway.bean.impl.GENERATION_RULE;

import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;
import com.feng.zhihao.apigeteway.entity.InterfaceFieldGenerationRule;
import com.feng.zhihao.apigeteway.entity.InterfaceFieldInfo;
import com.feng.zhihao.apigeteway.gateway.ReqContext;
import com.feng.zhihao.apigeteway.gateway.bean.GENERATION_RULE;

@Component("GENERATION_RULE_JSON")
public class GENERATION_RULE_JSON implements GENERATION_RULE {

	@Override
	public Object generationValue(InterfaceFieldInfo interfaceFieldInfo,
			InterfaceFieldGenerationRule rule, ReqContext reqContext) {
		return JSON.parse(rule.getJson());
	}

}
